cmake_minimum_required(VERSION 3.10)
project(JobScheduler)

# 设置C++标准为C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置编译器选项
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread")

# 查找源文件
set(SOURCES
    JobScheduler.cpp
)

# 查找头文件
set(HEADERS
    JobInterface.h
    JobScheduler.h
    Logger.h
    ExampleJobs.h
)

# 创建静态库
add_library(JobSchedulerLib STATIC ${SOURCES} ${HEADERS})

# 创建测试程序
add_executable(JobSchedulerTest test_main.cpp)

# 链接静态库
target_link_libraries(JobSchedulerTest JobSchedulerLib pthread)

# 设置包含目录
target_include_directories(JobSchedulerLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(JobSchedulerTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})